<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake新增对Cuda代码编译支持</title>
    <meta name="description" content="最近研究了下NVIDIA Cuda Toolkit的编译环境，并且在xmake 2.1.10开发版中，新增了对cuda编译环境的支持，可以直接编译*.cu代码。关于Cuda Toolkit相关说明以及安装文档，可参考官方文档：CUDA Toolkit Documentation。下载安装好Cuda SDK后，在m...">

    
    <meta name="keywords" content="xmake,lua,cuda,NVIDIA,GPU,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/cn/2018/03/09/support-cuda/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />

    <!-- css -->
    <link href="/css/reward.css" rel="stylesheet" type="text/css"> 




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/cn" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/?lang=0">
                    
                        <i class="fa fa-home"></i>English
                    </a>
                </li>

                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>项目
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/archive/">
                            
                        
                            <i class="fa fa-archive"></i>归档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/category/">
                            
                        
                            <i class="fa fa-th-list"></i>分类
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/tag/">
                            
                        
                            <i class="fa fa-tags"></i>标记
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/docs/">
                            
                        
                            <i class="fa fa-book"></i>文档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="https://xmake.io/#/zh-cn/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>社区
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/donation/">
                            
                        
                            <i class="fa fa-heart"></i>捐助
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/about/">
                            
                        
                            <i class="fa fa-user"></i>关于
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake新增对Cuda代码编译支持</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2018-03-09
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/cn/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/cn/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#cuda" title="Tag: cuda" rel="tag">cuda</a-->
        <a href="/cn/tag/#cuda" title="Tag: cuda" rel="tag">cuda</a>&nbsp;
    
        <!--a href="/tag/#NVIDIA" title="Tag: NVIDIA" rel="tag">NVIDIA</a-->
        <a href="/cn/tag/#NVIDIA" title="Tag: NVIDIA" rel="tag">NVIDIA</a>&nbsp;
    
        <!--a href="/tag/#GPU" title="Tag: GPU" rel="tag">GPU</a-->
        <a href="/cn/tag/#GPU" title="Tag: GPU" rel="tag">GPU</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p>最近研究了下NVIDIA Cuda Toolkit的编译环境，并且在xmake 2.1.10开发版中，新增了对cuda编译环境的支持，可以直接编译<code class="highlighter-rouge">*.cu</code>代码。</p>

<p>关于Cuda Toolkit相关说明以及安装文档，可参考官方文档：<a href="http://docs.nvidia.com/cuda/index.html">CUDA Toolkit Documentation</a>。</p>

<p>下载安装好Cuda SDK后，在macosx上回默认安装到<code class="highlighter-rouge">/Developer/NVIDIA/CUDA-x.x</code>目录下，Windows上可以通过<code class="highlighter-rouge">CUDA_PATH</code>的环境变量找到对应的SDK目录，而
Linux下默认会安装到<code class="highlighter-rouge">/usr/local/cuda</code>目录下。</p>

<p>xmake在执行<code class="highlighter-rouge">$ xmake</code> 命令编译<code class="highlighter-rouge">*.cu</code>代码的时候，会尝试探测这些默认的安装目录，然后尝试调用nvcc编译器直接编译cuda程序，大部分情况下只需要执行：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake
</code></pre>
</div>

<h4 id="创建和编译cuda工程">创建和编译Cuda工程</h4>

<p>我之前编译之前，我们可以通过xmake创建一个空的cuda工程，例如：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake create -l cuda <span class="nb">test</span>
<span class="gp">$ </span><span class="nb">cd test</span>
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>通过<code class="highlighter-rouge">-l</code>参数指定创建一个cuda代码工程，工程名为test，执行输出如下：</p>

<div class="highlighter-rouge"><pre class="highlight"><code>[00%]: ccache compiling.release src/main.cu
[100%]: linking.release test
</code></pre>
</div>

<p>我们也可以尝试直接运行这个cuda程序：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake run
</code></pre>
</div>

<p>接着我们来看下，这个cuda工程的<code class="highlighter-rouge">xmake.lua</code>文件：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="c1">-- define target</span>
<span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>

    <span class="c1">-- set kind</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>

    <span class="c1">-- add include directories</span>
    <span class="n">add_includedirs</span><span class="p">(</span><span class="s2">"inc"</span><span class="p">)</span>

    <span class="c1">-- add files</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cu"</span><span class="p">)</span>

    <span class="c1">-- generate SASS code for each SM architecture</span>
    <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">sm</span> <span class="k">in</span> <span class="nb">ipairs</span><span class="p">({</span><span class="s2">"30"</span><span class="p">,</span> <span class="s2">"35"</span><span class="p">,</span> <span class="s2">"37"</span><span class="p">,</span> <span class="s2">"50"</span><span class="p">,</span> <span class="s2">"52"</span><span class="p">,</span> <span class="s2">"60"</span><span class="p">,</span> <span class="s2">"61"</span><span class="p">,</span> <span class="s2">"70"</span><span class="p">})</span> <span class="k">do</span>
        <span class="n">add_cuflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_"</span> <span class="o">..</span> <span class="n">sm</span> <span class="o">..</span> <span class="s2">",code=sm_"</span> <span class="o">..</span> <span class="n">sm</span><span class="p">)</span>
        <span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_"</span> <span class="o">..</span> <span class="n">sm</span> <span class="o">..</span> <span class="s2">",code=sm_"</span> <span class="o">..</span> <span class="n">sm</span><span class="p">)</span>
    <span class="k">end</span>

    <span class="c1">-- generate PTX code from the highest SM architecture to guarantee forward-compatibility</span>
    <span class="n">sm</span> <span class="o">=</span> <span class="s2">"70"</span>
    <span class="n">add_cuflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_"</span> <span class="o">..</span> <span class="n">sm</span> <span class="o">..</span> <span class="s2">",code=compute_"</span> <span class="o">..</span> <span class="n">sm</span><span class="p">)</span>
    <span class="n">add_ldflags</span><span class="p">(</span><span class="s2">"-gencode arch=compute_"</span> <span class="o">..</span> <span class="n">sm</span> <span class="o">..</span> <span class="s2">",code=compute_"</span> <span class="o">..</span> <span class="n">sm</span><span class="p">)</span>
</code></pre>
</div>

<p>里面大部分跟C/C++的工程描述类似，唯一的区别就是通过<code class="highlighter-rouge">add_cuflags</code>设置了一些cuda代码特有的编译选项，这部分配置根据用户的需求，可自己调整。</p>

<p>关于<code class="highlighter-rouge">add_cuflags</code>的更多说明，可阅读<a href="http://xmake.io/#/zh/manual?id=targetadd_cuflags">xmake的官方文档</a>。</p>

<h4 id="cuda编译环境的配置">Cuda编译环境的配置</h4>

<p>默认情况下，xmake都能成功检测到系统中安装的Cuda SDK环境，用户不需要做额外的配置操作，当然如果遇到检测不到的情况，用户也可以手动指定Cuda SDK的路径：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f --cuda_dir<span class="o">=</span>/usr/local/cuda
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>来告诉xmake，你当前的Cuda SDK的安装目录在哪里。</p>

<p>如果想要测试xmake对当前cuda环境的探测支持，可以直接运行：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake l detect.sdks.find_cuda_toolchains
</code></pre>
</div>

<div class="language-js highlighter-rouge"><pre class="highlight"><code><span class="p">{</span>
    <span class="nx">linkdirs</span> <span class="o">=</span>
    <span class="p">{</span>
        <span class="o">/</span><span class="nx">Developer</span><span class="o">/</span><span class="nx">NVIDIA</span><span class="o">/</span><span class="nx">CUDA</span><span class="o">-</span><span class="mf">9.1</span><span class="o">/</span><span class="nx">lib</span>
    <span class="p">}</span>

<span class="p">,</span>   <span class="nx">bindir</span> <span class="o">=</span> <span class="sr">/Developer/</span><span class="nx">NVIDIA</span><span class="o">/</span><span class="nx">CUDA</span><span class="o">-</span><span class="mf">9.1</span><span class="o">/</span><span class="nx">bin</span>
<span class="p">,</span>   <span class="nx">includedirs</span> <span class="o">=</span>
    <span class="p">{</span>
        <span class="o">/</span><span class="nx">Developer</span><span class="o">/</span><span class="nx">NVIDIA</span><span class="o">/</span><span class="nx">CUDA</span><span class="o">-</span><span class="mf">9.1</span><span class="o">/</span><span class="nx">include</span>
    <span class="p">}</span>

<span class="p">,</span>   <span class="nx">cudadir</span> <span class="o">=</span> <span class="sr">/Developer/</span><span class="nx">NVIDIA</span><span class="o">/</span><span class="nx">CUDA</span><span class="o">-</span><span class="mf">9.1</span>
<span class="p">}</span>
</code></pre>
</div>

<p>来测试检测情况，甚至可以帮忙贡献相关检测代码<a href="https://github.com/xmake-io/xmake/blob/master/xmake/modules/detect/sdks/find_cuda_toolchains.lua">find_cuda_toolchains.lua</a>来改进xmake的检测过程。</p>

<h4 id="其他说明">其他说明</h4>

<p>注：目前对cuda的支持刚刚完成，还没正式发版，更多关于xmake对cuda的支持情况和进展，见：<a href="https://github.com/xmake-io/xmake/issues/158">issues #158</a>。</p>

<p>如果要试用此特性，可下载安装最新<a href="https://github.com/xmake-io/xmake.git">master版本</a>，或者下载<a href="https://github.com/xmake-io/xmake/releases/download/v2.1.9/xmake-v2.1.10-dev.exe">windows 2.1.10-dev安装包</a>。</p>

<p><img src="/static/img/xmake/cuda_test.gif" width="60%" /></p>

        </article>
        <hr>

        <!-- baidu ads -->
        

        <!-- reward -->
        <div style="text-align: center;">
            <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
              <span>赏</span>
            </button>
            <div id="QR" style="display: none;">
                <div id="wechat" style="display: inline-block">
                  <img id="wechat_qr" src="/static/img/weixin.png" alt="WeChat Pay"/>
                  <p>微信打赏</p>
                </div>
                <div id="alipay" style="display: inline-block">
                  <img id="alipay_qr" src="/static/img/alipay.png" alt="Alipay"/>
                  <p>支付宝打赏</p>
                </div>
            </div>
        </div>

        
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
        

        
        
            
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">相关文章</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/17/xmake-update-v2.6.2/">xmake v2.6.2 发布，新增 Linux 内核驱动模块构建支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 发布，使用 Lua5.4 运行时，Rust 和 C++ 混合编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 发布，改进 C++20 模块，并支持 Nim, Keil MDK 和 Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 发布，新增 Pascal/Swig 程序和 Lua53 运行时支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 发布，包依赖锁定和 Vala/Metal 语言编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>上一篇</strong> <a href="/cn/2018/02/03/update-v2.1.9/">xmake v2.1.9版本发布，增加可视化图形菜单配置</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        <p><strong>下一篇</strong> <a href="/cn/2018/03/26/build-project-so-simply/">xmake入门，构建项目原来可以如此简单</a></p>
        
    </div>
</div>


        <h2 id="comments">评论</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,       
  language: 'zh-CN',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">

            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    内容
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#english">English</a></li>
                    <li><a href="#similar_posts">相关文章</a></li>
                    <li><a href="#comments">评论</a></li>
                </ul>
            </div>


            <!-- baidu ads -->
            
            
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    链接
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- xmake courses -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    xmake 入门课程
                </div>
                <a href="https://xmake.io/#/zh-cn/about/course" target="_blank">
                <img src="/static/img/xmake-course.png" alt="course" width="256" height="193">
                </a>
            </div>

            <!-- qqgroup -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    技术交流群（QQ）
                </div>
                <img src="/static/img/qqgroup.png" alt="qqgroup" width="256" height="284">
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
